package com.pfizer.pfizerExpertForPad;

import java.util.Date;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.pfizer.DB.DataHelper;

public class BootReceiver extends BroadcastReceiver
{
	static final String ACTION = "android.intent.action.BOOT_COMPLETED";
	static final String ACTION_START_DATASYNC = "com.pfizer.pfizerExpertForPad.ACTION_START_DATASYNC";

	@Override
	public void onReceive(Context context, Intent intent) 
	{
		// TODO Auto-generated method stub
		if(intent.getAction().equals(ACTION)){
			DataHelper dHelper=new DataHelper(context);
			Date dt = new Date();
			dHelper.setLoopCount(0,dt.getTime());
			dHelper.clearDowning();
			dHelper.clearDownlog();
			DataSyncAlarm.setDataSyncAlarm(context, true,
					dt.getTime() + 60 * 1000);
			//DataSyncAlarm.setCheckDataSyncAlarm(context,true);
			//context.startService(new Intent(context, DataSyncService.class));
		}
	}
}
